<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  debugger;
  /*
    这个例子你可以发现 CLOSURE(a) 里包含了a1、a2两个属性,因为b里用到了a1,c里用到了a2
  */

  function a(){
    console.dir(b);
    var a1 = 'a1';
    console.dir(b);
    var a2 = 'a2';
    console.dir(b);
    function b(){
      console.log(a1);
    }
    b();
    console.dir(b);

    function c(){
      console.log(a2);
    }
    c();
    console.dir(c);
  }

  a()
</script>
</body>
</html>
